﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TestPlatform.Core;
using System.Data.SqlClient;
using TestPlatform.Performer.Mssql.EF.Entities;

namespace TestPlatform.Performer.Mssql.EF
{
    public class MssqlEFUpdatePerformer : BaseUpdatePerformer
    {
        public override string UnderlyinEngine { get { return "MSSQL - EF"; } }

        public MssqlEFUpdatePerformer()
            : base(new MssqlHelper())
        {

        }

        protected override void UpdateEntity(Guid id)
        {
            using (var c = new RepositoryContext())
            {
                User user = c.Users.SingleOrDefault(u => u.Id == id);
                user.Name = id.ToString();

                c.SaveChanges();
            }
        }
    }
}
